package com.dfbz.springboot_project.mapper;

import com.dfbz.springboot_project.entity.AdminRole;
import com.dfbz.springboot_project.entity.Role;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;

import java.util.ArrayList;

@org.apache.ibatis.annotations.Mapper
public interface AdminRoleMapper extends Mapper<AdminRole> {
    @Delete("DELETE " +
            "FROM " +
            " admin_role  " +
            "WHERE " +
            " admin_role.admin_id = #{Aid}")
    void DeleteByAid(Integer Aid);
    @InsertProvider(type = AdminRoleProvider.class,method = "InsertSelective")
    void InsertSelective(@Param("Aid") Integer Aid,@Param("roles") ArrayList<Role> roles);
}
